#from globals import *
import globals

def query_users () :

    #global globalActiveUserListLock
    #global globalActiveUserList

    #print "query function"
    returnString = ""

    try :
        globals.globalActiveUserListLock.acquire()
        for user in globals.globalActiveUserList :
            returnString = returnString + globals.globalActiveUserList[user].userName + ','+  globals.globalActiveUserList[user].status + ',' + globals.globalActiveUserList[user].available + ',' + globals.globalActiveUserList[user].firstName + ',' + globals.globalActiveUserList[user].lastName +','+globals.globalActiveUserList[user].group+';'
    finally :
        globals.globalActiveUserListLock.release()
    return returnString
